package com.thz.friend.controller.file;

import com.thz.common.core.controller.BaseController;
import com.thz.common.core.result.Result;
import com.thz.file.pojo.OSSResult;
import com.thz.friend.service.file.IFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description
 * @Author thz
 * @Date 2025/3/29
 */
@RestController
@RequestMapping("/file")
public class FileController extends BaseController {

    @Autowired
    private IFileService fileService;

    @PostMapping("/upload")
    public Result<OSSResult> upload(@RequestBody MultipartFile file) {
        return Result.ok(fileService.upload(file));
    }

}